.PHONY: concretemes concretelib cconcrete

###### Variables definition area ######
SRC_PATH 	:= $(OS_PATH)/$(PLAYER_PATH)
INC_PATH 	:= -I$(SRC_PATH)
CPP_FLAGS 	+= $(INC_PATH)
CONC_CPP_FILES 	:= $(wildcard $(SRC_PATH)/*.cpp)
CONC_OBJ_FILES	:= $(patsubst $(SRC_PATH)/%.cpp,$(BUILD_DIR)/%.o,$(CONC_CPP_FILES))


#### Targets ####
concretedep: $(SRC)
	$(CC) -M $(CPP_FLAGS) $^ > $@

-include $(subst .cpp,.d,$(SRC))

%.d: %.cpp
	$(CC) -M $(CPP_FLAGS) $< > $@.$$$$;			\
	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@;	\
	rm -f $@.$$$$

$(BUILD_DIR)/%.o: $(SRC_PATH)/%.cpp
	$(CC) $(W_FLAGS) $(CPP_FLAGS) -o $@ $<

concretemes:
	@echo "=> Building OpenNcl implementation concrete  for OS=$(OS) and PLAYER=$(PLAYER) ..."

concrete: concretemes $(CONC_OBJ_FILES)
	@test -d $(BUILD_DIR) || mkdir -pm 775 $(BUILD_DIR)

cconcrete:
	@echo "=> Cleaning OpenNcl implementation concrete ..."
	-$(RM) -rf $(CONC_OBJ_FILES)
